<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="com.sinodata.bsm.center.util.spring.SpringContextHolder"%>
<%@page import="com.sinodata.bsm.center.service.config.PortalService"%>
<%
PortalService service = SpringContextHolder.getBean(PortalService.class);
service.executeSql("call PROC_VIEW_INFRA_STAT()");
String sql = "select t.*, mt.name,mt.picture from view_infra_stat t, monitor_type mt where t.type_id = mt.id order by mt.seq";

System.out.println(sql.toString());
List<Map<String,Object>> list = service.findListBySql(sql.toString());
%>
<div style="height:212px; background:#fafafa; overflow:hidden;">
<%

for(int i=0;list!=null&& i<list.size(); i++){
    Map<String,Object> map = list.get(i);
    String name = map.get("NAME").toString();
    String motid = map.get("TYPE_ID").toString();
    String UN_RES_TOTAL = map.get("UN_RES_TOTAL")==null?"0":map.get("UN_RES_TOTAL").toString();
    String RES_TOTAL = map.get("RES_TOTAL").toString();
    String EVENT_TOTAL = map.get("EVENT_TOTAL").toString();
    String pic = map.get("picture".toUpperCase()).toString();
%>
	<div class="por-div">
	<ul class="xUl">
		<li style="margin-top:-8px; margin-bottom:5px;"><a href="#" class="xUla"><img src="../../style/default/images/equi/<%=pic %>" /></a></li>
		<li>
			<span><%=name%></span>
			<span>
				<%
					out.println(UN_RES_TOTAL);
				 %>
			</span>
			<span>/</span>
			<span><%=RES_TOTAL %></span>
		</li>
		<li>
			<span>共</span>
			<span>
					<%
						if(EVENT_TOTAL.equals("0")){
							out.println(EVENT_TOTAL);
						}else{
					%>
						<a href="${pageContext.request.contextPath}/event/active-event!common.action?showTotal=0&motiTypeId=<%=motid %>" target="_blank" class="data"><%=EVENT_TOTAL %></a>
					<%
						}
					 %>
			</span>
			<span>条事件</span>
		</li>
	</ul>

</div>
<% 
}
%>


</div>

